# 直接模拟得9分
def resolution1():
    n, m = map(int, input().split(" "))
    word_total = m
    word_last = m
    word_today = 0
    d = 1
    while (word_total < n):
        if word_last % 2 == 0:  # 偶数
            word_today = word_last / 2
        else:  # 奇数
            word_today = 3 * word_last + 1
        # print(word_today)
        word_total += word_today
        word_last = word_today
        d += 1
    print(d)


if __name__ == '__main__':
    resolution1()